package com.wanczy.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wanczy.mapper.DetailMapper;
import com.wanczy.pojo.Cart;
import com.wanczy.pojo.EvalUserGoods;
import com.wanczy.pojo.Favorite;
import com.wanczy.pojo.Goods;
import com.wanczy.pojo.Shop;
import com.wanczy.service.DetailService;

@Service
public class DetailServiceImpl implements DetailService {
	
	@Autowired
	private DetailMapper detailMapper;

	@Override
	public Goods findByGoodsId(Integer goodsId) {
		Goods goods = detailMapper.findByGoodsId(goodsId);
		return goods;
	}

	@Override
	public Shop findByShopId(Integer shopId) {
		Shop shop = detailMapper.findByShopId(shopId);
		return shop;
	}

	@Override
	public List<EvalUserGoods> queryEval(Integer goodsId) {
		List<EvalUserGoods> list = detailMapper.queryEval(goodsId);
		return list;
	}

	@Override
	public int addFavorite(Favorite favorite) {
		int count = detailMapper.addFavorite(favorite);
		return count;
	}

	@Override
	public Favorite queryFavorite(Favorite favorite) {
		Favorite fav = detailMapper.queryFavorite(favorite);
		return fav;
	}

	@Override
	public int addCart(Cart cart) {
		int count = detailMapper.addCart(cart);
		return count;
	}

	@Override
	public Cart queryCart(Cart cart) {
		Cart c = detailMapper.queryCart(cart);
		return c;
	}

}
